<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>{{count}}</h1>
        <button @click="add">app 求点击</button>
    </div>

    <div id="bpp">
        <h1>{{count}}</h1>
        <button @click="add">bpp 求点击</button>
    </div>
</body>
<script>

    const data = {
        count: 101
    }

    const app = {
        // 每个组件中都要有自己的独立数据
        // 所以 data 要是函数要 return 一个新的对象
        data () {
            return {
                count: 101,
                myObj: {}
            }
        },
        methods: {
            add () {
                this.count++
            }
        },
    }

    const vm = Vue.createApp(app).mount('#app')

    const newObj = {}
    console.log('11111', vm.myObj == newObj);
    console.log('vm.myObj', vm.myObj); // 是一个 vm.myObj Proxy {} 被代理了
    console.log('newObj', newObj); // 是一个普通对象  没有被代理不具备响应式

    const bpp = {
        data () {
            return {
                count: 101
            }
        },
        methods: {
            add () {
            }
        },
    }

    const vm2 = Vue.createApp(bpp).mount('#bpp')
</script>

</html>